package com.platform.hjt.crm.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.platform.hjt.sys.model.SysCompanyInfo;
import com.platform.hjt.sys.model.SysUserInfo;
import com.platform.hjt.sys.model.json.SysCompanyInfoSerialize;
import com.platform.hjt.sys.model.json.SysUserInfoSerialize;

/**
 * CrmCustomerInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "crm_customer_info")
public class CrmCustomerInfo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -7077084681568980359L;
	private String crmCustomerInfoId;
	
	private SysCompanyInfo sysCompanyInfo;
	private SysUserInfo sysUserInfo;
	@NotBlank(message="名称不能为空")
	@Length(max=100, message="名称长度不能超过100个字")
	private String customerName;
	private String customerAge;
	private String customerPhone;
	private String customerUnit;
	private String targetProvince;
	private String targetCity;
	private String targetArea;
	private String targetAddress;
	private String remark;
	private Timestamp createTime;
	private Boolean isDel;
	private Long sortIndex;
	
	private String fullPinyin;
	private String shortPinyin;

	// Constructors

	/** default constructor */
	public CrmCustomerInfo() {
	}

	/** minimal constructor */
	public CrmCustomerInfo(String crmCustomerInfoId) {
		this.crmCustomerInfoId = crmCustomerInfoId;
	}

	/** full constructor */
	public CrmCustomerInfo(String crmCustomerInfoId,
			SysCompanyInfo sysCompanyInfo, SysUserInfo sysUserInfo,
			String customerName, String customerAge, String customerPhone,
			String customerUnit, String targetProvince, String targetCity,
			String targetArea, String targetAddress, String remark,
			Timestamp createTime, Boolean isDel, Long sortIndex) {
		this.crmCustomerInfoId = crmCustomerInfoId;
		this.sysCompanyInfo = sysCompanyInfo;
		this.sysUserInfo = sysUserInfo;
		this.customerName = customerName;
		this.customerAge = customerAge;
		this.customerPhone = customerPhone;
		this.customerUnit = customerUnit;
		this.targetProvince = targetProvince;
		this.targetCity = targetCity;
		this.targetArea = targetArea;
		this.targetAddress = targetAddress;
		this.remark = remark;
		this.createTime = createTime;
		this.isDel = isDel;
		this.sortIndex = sortIndex;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "crm_customer_info_id", unique = true, nullable = false, length = 32)
	public String getCrmCustomerInfoId() {
		return this.crmCustomerInfoId;
	}

	public void setCrmCustomerInfoId(String crmCustomerInfoId) {
		this.crmCustomerInfoId = crmCustomerInfoId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_company_info_id")
	@JsonSerialize(using = SysCompanyInfoSerialize.class)
	public SysCompanyInfo getSysCompanyInfo() {
		return this.sysCompanyInfo;
	}

	public void setSysCompanyInfo(SysCompanyInfo sysCompanyInfo) {
		this.sysCompanyInfo = sysCompanyInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_user_info_id")
	@JsonSerialize(using = SysUserInfoSerialize.class)
	public SysUserInfo getSysUserInfo() {
		return this.sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}

	@Column(name = "customer_name", length = 50)
	public String getCustomerName() {
		return this.customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@Column(name = "customer_age", length = 20)
	public String getCustomerAge() {
		return this.customerAge;
	}

	public void setCustomerAge(String customerAge) {
		this.customerAge = customerAge;
	}

	@Column(name = "customer_phone", length = 20)
	public String getCustomerPhone() {
		return this.customerPhone;
	}

	public void setCustomerPhone(String customerPhone) {
		this.customerPhone = customerPhone;
	}

	@Column(name = "customer_unit", length = 200)
	public String getCustomerUnit() {
		return this.customerUnit;
	}

	public void setCustomerUnit(String customerUnit) {
		this.customerUnit = customerUnit;
	}

	@Column(name = "target_province", length = 50)
	public String getTargetProvince() {
		return this.targetProvince;
	}

	public void setTargetProvince(String targetProvince) {
		this.targetProvince = targetProvince;
	}

	@Column(name = "target_city", length = 50)
	public String getTargetCity() {
		return this.targetCity;
	}

	public void setTargetCity(String targetCity) {
		this.targetCity = targetCity;
	}

	@Column(name = "target_area", length = 50)
	public String getTargetArea() {
		return this.targetArea;
	}

	public void setTargetArea(String targetArea) {
		this.targetArea = targetArea;
	}

	@Column(name = "target_address", length = 500)
	public String getTargetAddress() {
		return this.targetAddress;
	}

	public void setTargetAddress(String targetAddress) {
		this.targetAddress = targetAddress;
	}

	@Column(name = "remark", length = 500)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "is_del")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	@Column(name = "sort_index")
	public Long getSortIndex() {
		return this.sortIndex;
	}

	public void setSortIndex(Long sortIndex) {
		this.sortIndex = sortIndex;
	}

	@Column(name = "full_pinyin")
	public String getFullPinyin() {
		return fullPinyin;
	}

	public void setFullPinyin(String fullPinyin) {
		this.fullPinyin = fullPinyin;
	}
	
	@Column(name = "short_pinyin")
	public String getShortPinyin() {
		return shortPinyin;
	}

	public void setShortPinyin(String shortPinyin) {
		this.shortPinyin = shortPinyin;
	}

}